1: | rev(nil) | → nil | |
2: | rev(cons(x,l)) | → cons(rev1(x,l),rev2(x,l)) | |
3: | rev1(0,nil) | → 0 | |
4: | rev1(s(x),nil) | → s(x) | |
5: | rev1(x,cons(y,l)) | → rev1(y,l) | |
6: | rev2(x,nil) | → nil | |
7: | rev2(x,cons(y,l)) | → rev(cons(x,rev2(y,l))) | |
8: | REV(cons(x,l)) | → REV1(x,l) | |
9: | REV(cons(x,l)) | → REV2(x,l) | |
10: | REV1(x,cons(y,l)) | → REV1(y,l) | |
11: | REV2(x,cons(y,l)) | → REV(cons(x,rev2(y,l))) | |
12: | REV2(x,cons(y,l)) | → REV2(y,l) | |